package com.zmsk.zmio.handler;

import android.content.Context;
import android.content.Intent;

import com.example.jni.DeviceJNI;
import com.zmsk.zmio.inter.IIOHandler;

public class HuaChengHandler implements IIOHandler {
    @Override
    public void initIOControl(Context context) {

    }

    @Override
    public void stopIOControl(Context context) {

    }

    @Override
    public void noticeGateOpen(Context context, String idNumber) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO2");
        intent.putExtra("gpio2_open", true);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeGateClose(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO2");
        intent.putExtra("gpio2_open", false);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeWhiteLedOn(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO0");
        intent.putExtra("gpio0_open", true);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeWhiteLedOff(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO0");
        intent.putExtra("gpio0_open", false);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeInfraredLedOn(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO3");
        intent.putExtra("gpio3_open", true);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeInfraredLedOff(Context context) {
        Intent intent = new Intent();
        intent.setAction("android.intent.action.GPIO3");
        intent.putExtra("gpio3_open", true);
        context.sendBroadcast(intent);
    }

    @Override
    public void noticeRedLedOn(Context context) {

    }

    @Override
    public void noticeRedLedOff(Context context) {

    }

    @Override
    public void noticeGreenLedOn(Context context) {

    }

    @Override
    public void noticeGreenLedOff(Context context) {

    }

    @Override
    public void handleSlientInstall(String path) {

    }
}
